import random

# 全局变量，记录上一次出拳的结果
my_prev_choice = None
opp_prev_choice = None

def lastmove(move):
    global opp_prev_choice
    opp_prev_choice = move

def check_last_win():
    global my_prev_choice, opp_prev_choice
    if my_prev_choice is None or opp_prev_choice is None:
        return None
        
    if my_prev_choice == opp_prev_choice:
        return '平局'
    elif (my_prev_choice == '剪刀' and opp_prev_choice == '石头') or \
         (my_prev_choice == '石头' and opp_prev_choice == '布') or \
         (my_prev_choice == '布' and opp_prev_choice == '剪刀'):
        return '败'
    else:
        return '胜'

def make_move():
    global my_prev_choice, opp_prev_choice
    choices = ['剪刀', '石头', '布']

    # 根据上一次对局结果选择下一次出拳
    if opp_prev_choice is None:
        choice = random.choice(choices)
    elif check_last_win() in ['胜', '平局']:
        choice = random.choice(choices)
    elif opp_prev_choice == '剪刀':
        choice = '石头'
    elif opp_prev_choice == '石头':
        choice = '布'
    else:
        choice = '剪刀'

    my_prev_choice = choice
    return choice